package com.example.userlogincenter.userCenter.util;


import cn.hutool.core.util.CharsetUtil;
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;
import com.google.common.primitives.Bytes;
import org.springframework.util.DigestUtils;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;

/**
 *
 * 加密工具类
 * */
public class encrypUtils {

    /**
     * 为value进行md5加密
     * 返回密钥+密文
     * */
    public static String encrypValue(String value,String salt) throws UnsupportedEncodingException {
        //密码加言
        String password = value + salt;
        String encryPassword = DigestUtils.md5DigestAsHex(password.getBytes(StandardCharsets.UTF_8));
        return encryPassword;
    }


}
